package com.codingfuture.vo;

import java.io.Serializable;

public class Result implements Serializable {
    private int code;
    private String msg;
    private Object data;

    public static Result ok(){
        Result result = new Result();
        result.setCode(200);
        result.setMsg("OK");
        return result;
    }

    public static Result ok(Object data){
        Result result = ok();
        result.setData(data);
        return result;
    }

    public static Result err(){
        Result result = new Result();
        result.setCode(500);
        result.setMsg("ERROR");
        return result;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
